<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/algorithm/string/finder.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/algorithm/string</a> - finder.hpp<span style="font-size: 80%;"> (source / <a href="finder.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : //  Boost string_algo library finder.hpp header file  ---------------------------//</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : //  Copyright Pavol Droba 2002-2006.
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // Distributed under the Boost Software License, Version 1.0.
<span class="lineNum">       6 </span>            : //    (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       7 </span>            : //          http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       8 </span>            : 
<span class="lineNum">       9 </span>            : //  See http://www.boost.org/ for updates, documentation, and revision history.
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : #ifndef BOOST_STRING_FINDER_HPP
<span class="lineNum">      12 </span>            : #define BOOST_STRING_FINDER_HPP
<span class="lineNum">      13 </span>            : 
<span class="lineNum">      14 </span>            : #include &lt;boost/algorithm/string/config.hpp&gt;
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span>            : #include &lt;boost/range/iterator_range_core.hpp&gt;
<span class="lineNum">      17 </span>            : #include &lt;boost/range/begin.hpp&gt;
<span class="lineNum">      18 </span>            : #include &lt;boost/range/end.hpp&gt;
<span class="lineNum">      19 </span>            : #include &lt;boost/range/iterator.hpp&gt;
<span class="lineNum">      20 </span>            : #include &lt;boost/range/const_iterator.hpp&gt;
<span class="lineNum">      21 </span>            : 
<span class="lineNum">      22 </span>            : #include &lt;boost/algorithm/string/constants.hpp&gt;
<span class="lineNum">      23 </span>            : #include &lt;boost/algorithm/string/detail/finder.hpp&gt;
<span class="lineNum">      24 </span>            : #include &lt;boost/algorithm/string/compare.hpp&gt;
<span class="lineNum">      25 </span>            : 
<span class="lineNum">      26 </span>            : /*! \file
<span class="lineNum">      27 </span>            :     Defines Finder generators. Finder object is a functor which is able to 
<span class="lineNum">      28 </span>            :     find a substring matching a specific criteria in the input.
<span class="lineNum">      29 </span>            :     Finders are used as a pluggable components for replace, find 
<span class="lineNum">      30 </span>            :     and split facilities. This header contains generator functions 
<span class="lineNum">      31 </span>            :     for finders provided in this library.
<span class="lineNum">      32 </span>            : */
<span class="lineNum">      33 </span>            : 
<span class="lineNum">      34 </span>            : namespace boost {
<span class="lineNum">      35 </span>            :     namespace algorithm {
<span class="lineNum">      36 </span>            : 
<span class="lineNum">      37 </span>            : //  Finder generators ------------------------------------------//
<span class="lineNum">      38 </span>            :         
<span class="lineNum">      39 </span>            :         //! &quot;First&quot; finder 
<span class="lineNum">      40 </span>            :         /*!
<span class="lineNum">      41 </span>            :             Construct the \c first_finder. The finder searches for the first
<span class="lineNum">      42 </span>            :             occurrence of the string in a given input.
<span class="lineNum">      43 </span>            :             The result is given as an \c iterator_range delimiting the match.
<span class="lineNum">      44 </span>            : 
<span class="lineNum">      45 </span>            :             \param Search A substring to be searched for.
<span class="lineNum">      46 </span>            :             \param Comp An element comparison predicate
<span class="lineNum">      47 </span>            :             \return An instance of the \c first_finder object
<span class="lineNum">      48 </span>            :         */
<span class="lineNum">      49 </span>            :         template&lt;typename RangeT&gt;
<span class="lineNum">      50 </span>            :         inline detail::first_finderF&lt;
<span class="lineNum">      51 </span>            :             BOOST_STRING_TYPENAME range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">      52 </span>            :             is_equal&gt;
<span class="lineNum">      53 </span>            :         first_finder( const RangeT&amp; Search )
<span class="lineNum">      54 </span>            :         {
<span class="lineNum">      55 </span>            :             return 
<span class="lineNum">      56 </span>            :                 detail::first_finderF&lt;
<span class="lineNum">      57 </span>            :                     BOOST_STRING_TYPENAME 
<span class="lineNum">      58 </span>            :                         range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">      59 </span>            :                         is_equal&gt;( ::boost::as_literal(Search), is_equal() ) ;
<span class="lineNum">      60 </span>            :         }
<span class="lineNum">      61 </span>            : 
<span class="lineNum">      62 </span>            :         //! &quot;First&quot; finder
<span class="lineNum">      63 </span>            :         /*!
<span class="lineNum">      64 </span>            :             \overload
<span class="lineNum">      65 </span>            :         */
<span class="lineNum">      66 </span>            :         template&lt;typename RangeT,typename PredicateT&gt;
<span class="lineNum">      67 </span>            :         inline detail::first_finderF&lt;
<span class="lineNum">      68 </span>            :             BOOST_STRING_TYPENAME range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">      69 </span>            :             PredicateT&gt;
<span class="lineNum">      70 </span>            :         first_finder( 
<span class="lineNum">      71 </span>            :             const RangeT&amp; Search, PredicateT Comp )
<span class="lineNum">      72 </span>            :         {
<span class="lineNum">      73 </span>            :             return 
<span class="lineNum">      74 </span>            :                 detail::first_finderF&lt;
<span class="lineNum">      75 </span>            :                     BOOST_STRING_TYPENAME 
<span class="lineNum">      76 </span>            :                         range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">      77 </span>            :                     PredicateT&gt;( ::boost::as_literal(Search), Comp );
<span class="lineNum">      78 </span>            :         }
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span>            :         //! &quot;Last&quot; finder
<span class="lineNum">      81 </span>            :         /*!
<span class="lineNum">      82 </span>            :             Construct the \c last_finder. The finder searches for the last
<span class="lineNum">      83 </span>            :             occurrence of the string in a given input.
<span class="lineNum">      84 </span>            :             The result is given as an \c iterator_range delimiting the match.
<span class="lineNum">      85 </span>            : 
<span class="lineNum">      86 </span>            :             \param Search A substring to be searched for.
<span class="lineNum">      87 </span>            :             \param Comp An element comparison predicate
<span class="lineNum">      88 </span>            :             \return An instance of the \c last_finder object
<span class="lineNum">      89 </span>            :         */
<span class="lineNum">      90 </span>            :         template&lt;typename RangeT&gt;
<span class="lineNum">      91 </span>            :         inline detail::last_finderF&lt;
<span class="lineNum">      92 </span>            :             BOOST_STRING_TYPENAME range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">      93 </span>            :             is_equal&gt;
<span class="lineNum">      94 </span>            :         last_finder( const RangeT&amp; Search )
<span class="lineNum">      95 </span>            :         {
<span class="lineNum">      96 </span>            :             return 
<span class="lineNum">      97 </span>            :                 detail::last_finderF&lt;
<span class="lineNum">      98 </span>            :                     BOOST_STRING_TYPENAME 
<span class="lineNum">      99 </span>            :                         range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     100 </span>            :                     is_equal&gt;( ::boost::as_literal(Search), is_equal() );
<span class="lineNum">     101 </span>            :         }
<span class="lineNum">     102 </span>            :         //! &quot;Last&quot; finder
<span class="lineNum">     103 </span>            :         /*!
<span class="lineNum">     104 </span>            :             \overload
<span class="lineNum">     105 </span>            :         */
<span class="lineNum">     106 </span>            :         template&lt;typename RangeT, typename PredicateT&gt;
<span class="lineNum">     107 </span>            :         inline detail::last_finderF&lt;
<span class="lineNum">     108 </span>            :             BOOST_STRING_TYPENAME range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     109 </span>            :             PredicateT&gt;
<span class="lineNum">     110 </span>            :         last_finder( const RangeT&amp; Search, PredicateT Comp )
<span class="lineNum">     111 </span>            :         {
<span class="lineNum">     112 </span>            :             return 
<span class="lineNum">     113 </span>            :                 detail::last_finderF&lt;
<span class="lineNum">     114 </span>            :                     BOOST_STRING_TYPENAME 
<span class="lineNum">     115 </span>            :                         range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     116 </span>            :                     PredicateT&gt;( ::boost::as_literal(Search), Comp ) ;
<span class="lineNum">     117 </span>            :         }
<span class="lineNum">     118 </span>            : 
<span class="lineNum">     119 </span>            :         //! &quot;Nth&quot; finder
<span class="lineNum">     120 </span>            :         /*!
<span class="lineNum">     121 </span>            :             Construct the \c nth_finder. The finder searches for the n-th (zero-indexed)
<span class="lineNum">     122 </span>            :             occurrence of the string in a given input.
<span class="lineNum">     123 </span>            :             The result is given as an \c iterator_range delimiting the match.
<span class="lineNum">     124 </span>            : 
<span class="lineNum">     125 </span>            :             \param Search A substring to be searched for.
<span class="lineNum">     126 </span>            :             \param Nth An index of the match to be find
<span class="lineNum">     127 </span>            :             \param Comp An element comparison predicate
<span class="lineNum">     128 </span>            :             \return An instance of the \c nth_finder object
<span class="lineNum">     129 </span>            :         */
<span class="lineNum">     130 </span>            :         template&lt;typename RangeT&gt;
<span class="lineNum">     131 </span>            :         inline detail::nth_finderF&lt;
<span class="lineNum">     132 </span>            :             BOOST_STRING_TYPENAME range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     133 </span>            :             is_equal&gt;
<span class="lineNum">     134 </span>            :         nth_finder( 
<span class="lineNum">     135 </span>            :             const RangeT&amp; Search, 
<span class="lineNum">     136 </span>            :             int Nth)
<span class="lineNum">     137 </span>            :         {
<span class="lineNum">     138 </span>            :             return 
<span class="lineNum">     139 </span>            :                 detail::nth_finderF&lt;
<span class="lineNum">     140 </span>            :                     BOOST_STRING_TYPENAME 
<span class="lineNum">     141 </span>            :                         range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     142 </span>            :                     is_equal&gt;( ::boost::as_literal(Search), Nth, is_equal() ) ;
<span class="lineNum">     143 </span>            :         }
<span class="lineNum">     144 </span>            :         //! &quot;Nth&quot; finder
<span class="lineNum">     145 </span>            :         /*!
<span class="lineNum">     146 </span>            :             \overload
<span class="lineNum">     147 </span>            :         */
<span class="lineNum">     148 </span>            :         template&lt;typename RangeT, typename PredicateT&gt;
<span class="lineNum">     149 </span>            :         inline detail::nth_finderF&lt;
<span class="lineNum">     150 </span>            :             BOOST_STRING_TYPENAME range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     151 </span>            :             PredicateT&gt;
<span class="lineNum">     152 </span>            :         nth_finder( 
<span class="lineNum">     153 </span>            :             const RangeT&amp; Search, 
<span class="lineNum">     154 </span>            :             int Nth, 
<span class="lineNum">     155 </span>            :             PredicateT Comp )
<span class="lineNum">     156 </span>            :         {
<span class="lineNum">     157 </span>            :             return 
<span class="lineNum">     158 </span>            :                 detail::nth_finderF&lt;
<span class="lineNum">     159 </span>            :                     BOOST_STRING_TYPENAME 
<span class="lineNum">     160 </span>            :                         range_const_iterator&lt;RangeT&gt;::type,
<span class="lineNum">     161 </span>            :                     PredicateT&gt;( ::boost::as_literal(Search), Nth, Comp );
<span class="lineNum">     162 </span>            :         }
<span class="lineNum">     163 </span>            : 
<span class="lineNum">     164 </span>            :         //! &quot;Head&quot; finder
<span class="lineNum">     165 </span>            :         /*!
<span class="lineNum">     166 </span>            :             Construct the \c head_finder. The finder returns a head of a given
<span class="lineNum">     167 </span>            :             input. The head is a prefix of a string up to n elements in
<span class="lineNum">     168 </span>            :             size. If an input has less then n elements, whole input is 
<span class="lineNum">     169 </span>            :             considered a head.
<span class="lineNum">     170 </span>            :             The result is given as an \c iterator_range delimiting the match.
<span class="lineNum">     171 </span>            : 
<span class="lineNum">     172 </span>            :             \param N The size of the head
<span class="lineNum">     173 </span>            :             \return An instance of the \c head_finder object
<span class="lineNum">     174 </span>            :         */
<span class="lineNum">     175 </span>            :         inline detail::head_finderF
<span class="lineNum">     176 </span>            :         head_finder( int N )
<span class="lineNum">     177 </span>            :         {
<span class="lineNum">     178 </span>            :             return detail::head_finderF(N);
<span class="lineNum">     179 </span>            :         }
<span class="lineNum">     180 </span>            :         
<span class="lineNum">     181 </span>            :         //! &quot;Tail&quot; finder
<span class="lineNum">     182 </span>            :         /*!
<span class="lineNum">     183 </span>            :             Construct the \c tail_finder. The finder returns a tail of a given
<span class="lineNum">     184 </span>            :             input. The tail is a suffix of a string up to n elements in
<span class="lineNum">     185 </span>            :             size. If an input has less then n elements, whole input is 
<span class="lineNum">     186 </span>            :             considered a head.
<span class="lineNum">     187 </span>            :             The result is given as an \c iterator_range delimiting the match.
<span class="lineNum">     188 </span>            : 
<span class="lineNum">     189 </span>            :             \param N The size of the head
<span class="lineNum">     190 </span>            :             \return An instance of the \c tail_finder object
<span class="lineNum">     191 </span>            :         */
<span class="lineNum">     192 </span>            :         inline detail::tail_finderF
<span class="lineNum">     193 </span>            :         tail_finder( int N )
<span class="lineNum">     194 </span>            :         {
<span class="lineNum">     195 </span>            :             return detail::tail_finderF(N);
<span class="lineNum">     196 </span>            :         }
<span class="lineNum">     197 </span>            : 
<span class="lineNum">     198 </span>            :         //! &quot;Token&quot; finder
<span class="lineNum">     199 </span>            :         /*!
<span class="lineNum">     200 </span>            :             Construct the \c token_finder. The finder searches for a token 
<span class="lineNum">     201 </span>            :             specified by a predicate. It is similar to std::find_if 
<span class="lineNum">     202 </span>            :             algorithm, with an exception that it return a range of
<span class="lineNum">     203 </span>            :             instead of a single iterator.
<span class="lineNum">     204 </span>            : 
<span class="lineNum">     205 </span>            :             If &quot;compress token mode&quot; is enabled, adjacent matching tokens are 
<span class="lineNum">     206 </span>            :             concatenated into one match. Thus the finder can be used to 
<span class="lineNum">     207 </span>            :             search for continuous segments of characters satisfying the 
<span class="lineNum">     208 </span>            :             given predicate.
<span class="lineNum">     209 </span>            : 
<span class="lineNum">     210 </span>            :             The result is given as an \c iterator_range delimiting the match.
<span class="lineNum">     211 </span>            : 
<span class="lineNum">     212 </span>            :             \param Pred An element selection predicate
<span class="lineNum">     213 </span>            :             \param eCompress Compress flag
<span class="lineNum">     214 </span>            :             \return An instance of the \c token_finder object
<span class="lineNum">     215 </span>            :         */
<a name="216"><span class="lineNum">     216 </span>            :         template&lt; typename PredicateT &gt;</a>
<span class="lineNum">     217 </span>            :         inline detail::token_finderF&lt;PredicateT&gt;
<span class="lineNum">     218 </span><span class="lineCov">          1 :         token_finder( </span>
<span class="lineNum">     219 </span>            :             PredicateT Pred, 
<span class="lineNum">     220 </span>            :             token_compress_mode_type eCompress=token_compress_off )
<span class="lineNum">     221 </span>            :         {
<span class="lineNum">     222 </span><span class="lineCov">          2 :             return detail::token_finderF&lt;PredicateT&gt;( Pred, eCompress );</span>
<span class="lineNum">     223 </span>            :         }
<span class="lineNum">     224 </span>            : 
<span class="lineNum">     225 </span>            :         //! &quot;Range&quot; finder
<span class="lineNum">     226 </span>            :         /*!
<span class="lineNum">     227 </span>            :             Construct the \c range_finder. The finder does not perform 
<span class="lineNum">     228 </span>            :             any operation. It simply returns the given range for 
<span class="lineNum">     229 </span>            :             any input. 
<span class="lineNum">     230 </span>            : 
<span class="lineNum">     231 </span>            :             \param Begin Beginning of the range
<span class="lineNum">     232 </span>            :             \param End End of the range
<span class="lineNum">     233 </span>            :             \param Range The range.
<span class="lineNum">     234 </span>            :             \return An instance of the \c range_finger object
<span class="lineNum">     235 </span>            :         */
<span class="lineNum">     236 </span>            :         template&lt; typename ForwardIteratorT &gt;
<span class="lineNum">     237 </span>            :         inline detail::range_finderF&lt;ForwardIteratorT&gt;
<span class="lineNum">     238 </span>            :         range_finder(
<span class="lineNum">     239 </span>            :             ForwardIteratorT Begin,
<span class="lineNum">     240 </span>            :             ForwardIteratorT End )
<span class="lineNum">     241 </span>            :         {
<span class="lineNum">     242 </span>            :             return detail::range_finderF&lt;ForwardIteratorT&gt;( Begin, End );
<span class="lineNum">     243 </span>            :         }
<span class="lineNum">     244 </span>            : 
<span class="lineNum">     245 </span>            :         //! &quot;Range&quot; finder
<span class="lineNum">     246 </span>            :         /*!       
<span class="lineNum">     247 </span>            :             \overload
<span class="lineNum">     248 </span>            :         */
<span class="lineNum">     249 </span>            :         template&lt; typename ForwardIteratorT &gt;
<span class="lineNum">     250 </span>            :         inline detail::range_finderF&lt;ForwardIteratorT&gt;
<span class="lineNum">     251 </span>            :         range_finder( iterator_range&lt;ForwardIteratorT&gt; Range )
<span class="lineNum">     252 </span>            :         {
<span class="lineNum">     253 </span>            :             return detail::range_finderF&lt;ForwardIteratorT&gt;( Range );
<span class="lineNum">     254 </span>            :         }
<span class="lineNum">     255 </span>            : 
<span class="lineNum">     256 </span>            :     } // namespace algorithm
<span class="lineNum">     257 </span>            : 
<span class="lineNum">     258 </span>            :     // pull the names to the boost namespace
<span class="lineNum">     259 </span>            :     using algorithm::first_finder;
<span class="lineNum">     260 </span>            :     using algorithm::last_finder;
<span class="lineNum">     261 </span>            :     using algorithm::nth_finder;
<span class="lineNum">     262 </span>            :     using algorithm::head_finder;
<span class="lineNum">     263 </span>            :     using algorithm::tail_finder;
<span class="lineNum">     264 </span>            :     using algorithm::token_finder;
<span class="lineNum">     265 </span>            :     using algorithm::range_finder;
<span class="lineNum">     266 </span>            : 
<span class="lineNum">     267 </span>            : } // namespace boost
<span class="lineNum">     268 </span>            : 
<span class="lineNum">     269 </span>            : 
<span class="lineNum">     270 </span>            : #endif  // BOOST_STRING_FINDER_HPP
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
